<template>



  <div class="app-container">

		<div class="filter-container">
			<el-input  style="width: 200px;"   v-model="query.fullName" placeholder="姓名" class="filter-item"  ></el-input>
			<el-input  style="width: 200px;"   v-model="query.code" placeholder="记录编码" class="filter-item"  ></el-input>
			<el-input  style="width: 200px;"   v-model="query.writerName" placeholder="录入人员" class="filter-item"  ></el-input>

			 <el-select v-model="query.type" class="filter-item"  placeholder="订单类型">
					<el-option :label="'全部'" :value="2"></el-option>
					<el-option :label="'往返'" :value="1"></el-option>
					<el-option :label="'单程'" :value="0"></el-option>
			</el-select>

      <el-date-picker class="filter-item"
        v-model="query.startDate"
        type="date"
        placeholder="出发日期"
        value-format="yyyy-MM-dd"
      >
      </el-date-picker>

      <el-date-picker class="filter-item"
        v-model="query.createdAt" value-format="yyyy-MM-dd HH:mm:ss"
        type="datetimerange"
        range-separator="至"
        start-placeholder="录入开始日期"
        end-placeholder="录入结束日期">
      </el-date-picker>
      <br/>

      <el-button @click="getRecords" type="primary" class="filter-item">查询</el-button>

<!--      <el-button v-if="currentAuth.indexOf('1')>=0" @click="openAddDialog" type="primary" class="filter-item">添加</el-button>-->
      <el-button   v-if="currentAuth.indexOf('1')>=0" @click="openAddDialog" type="primary" class="filter-item">添加</el-button>
      <el-button   v-if="currentAuth.indexOf('5')>=0" @click="download" type="primary" class="filter-item">导出</el-button>

      <div  v-if="currentAuth.indexOf('4')>=0" class="filter-item">
        <el-upload
          style="margin-left: 10px"
          :action="host+'/guard/importFile?importType=flight&token='+token"
          accept=".xls,.xlsx,.csv"
          :on-success="uploadSuccess"
          :on-error="uploadError"
          :on-progress="uploadProcess"
          :show-file-list="false">
          <el-button type="primary">导入</el-button>
        </el-upload>
      </div>

      <el-button style="margin-left: 10px" @click="getRecords" type="primary" class="filter-item">刷新</el-button>
      <el-button @click="downloadCsv" type="primary" class="filter-item">下载模板</el-button>
      <el-button v-if="currentAuth.indexOf('3')>=0" style="margin-left: 10px" @click="handleMultDel" type="danger" class="filter-item">批量删除</el-button>
		</div>

		<el-table  @selection-change="handleSelectionChange" v-loading="listLoading"	:data="list"	element-loading-text="Loading"	border	fit	highlight-current-row v-horizontal-scroll="'always'">
			 <el-table-column type="selection" width="55" />
			<el-table-column fixed="left" prop="id" label="ID" min-width="80" />
      <el-table-column fixed="left" label="操作" min-width="140">
        <template slot-scope="scope">
          <el-button  v-if="currentAuth.indexOf('2')>=0" size="mini" type="text" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
          <el-button size="mini" type="text" @click="handleBeizhu(scope.$index, scope.row)">备注</el-button>
          <el-button v-if="currentAuth.indexOf('3')>=0" size="mini" type="text" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
          <el-button v-if="currentAuth.indexOf('7')>=0" size="mini" type="text" @click="downloadPDF(scope.$index, scope.row)">下载PDF</el-button>
          <!--					<el-button  size="mini" type="text" @click="handleDownload(scope.$index, scope.row)">下载</el-button>-->
        </template>
      </el-table-column>
      <el-table-column prop="code" label="记录编码" min-width="120" />
      <el-table-column show-overflow-tooltip prop="beizhu" label="备注" min-width="300" />
      <el-table-column prop="flight_no" label="航班号" min-width="230" />
      <el-table-column prop="is_double" label="航班类型" min-width="80" />
      <el-table-column prop="date" label="出发日期" min-width="200" />
      <el-table-column prop="name" label="乘客姓名" min-width="100" />
<!--      <el-table-column prop="last_name" label="乘客姓" min-width="100" />-->
<!--			<el-table-column prop="first_name" label="乘客名" min-width="100" />-->
			<el-table-column prop="passenger_sex" label="乘客性别" min-width="80" />
			<el-table-column prop="passport" label="护照号码" min-width="120" />
			<el-table-column prop="passenger_birthday" label="乘客生日" min-width="120" />
			<el-table-column prop="passenger_type" label="机票类型" min-width="120" />
			<el-table-column prop="start_fly_time" label="起飞时间" min-width="110" />
			<el-table-column prop="end_fly_time" label="降落时间" min-width="110" />
			<el-table-column prop="get_flight_info.start_airport" label="起飞机场" min-width="150" />
			<el-table-column prop="get_flight_info.end_airport" label="降落机场" min-width="150" />
			<el-table-column prop="created_at" label="创建时间" min-width="160" />
			<el-table-column prop="get_writer.name" label="录入人员" min-width="150" />

		</el-table>

    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="pagination.page"
      :page-sizes="[10, 20, 100, 200]"
      :page-size="pagination.pageSize"
      :background="true"
      layout="total, sizes, prev, pager, next, jumper"
      :total="pagination.total">
    </el-pagination>

    <el-dialog :title="'添加'"  :visible.sync="addDialogFormVisible">
      <el-form :inline="true" ref="form" :model="form" label-width="100px" class="demo-form-inline" v-loading="formLoading" >
        <el-form-item label="记录编码：" >
          <el-input v-model="form.code"  placeholder="如不输入，系统将默认生成"></el-input>
        </el-form-item>
        <el-form-item label="乘客数量：" >
          <el-input v-model.number="form.count"></el-input>
        </el-form-item>
        <el-form-item label="乘客姓名：" >
          <el-input v-model="form.name"></el-input>
        </el-form-item>
        <el-form-item label="乘客性别：" >
          <el-select v-model="form.passenger_sex" placeholder="请选择">
            <el-option key="1" label="男" value="M" ></el-option>
            <el-option key="2" label="女" value="F" ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="乘客生日："  >
          <el-date-picker
            value-format="yyyy-MM-dd"
            v-model="form.passenger_birthday"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="护照号码：" >
          <el-input v-model="form.passport"></el-input>
        </el-form-item>
        <el-form-item label="是否往返：" >
          <el-switch
            v-model="form.is_double"
            active-text="是"
            inactive-text="否">
          </el-switch>
        </el-form-item>
        <br/>

        <el-form-item label="日期：" >
          <el-date-picker @change="changeFlightDate0"
            v-model="form.flight_dates[0]" type="date" placeholder="选择日期" :picker-options="pickerOptions" value-format="yyyy-MM-dd">
          </el-date-picker>
        </el-form-item>
        <el-form-item v-if="form.is_double" label="返程日期：" >
          <el-date-picker @change="changeFlightDate1" v-model="form.flight_dates[1]" type="date" placeholder="选择日期" :picker-options="pickerOptions" value-format="yyyy-MM-dd"></el-date-picker>
        </el-form-item>



        <div >
          <el-form-item label="航班：" >
            <el-select v-model="form.flight_ids[0]" placeholder="请选择">
              <el-option v-for="item in option0" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
            <template v-for="ele in  option0">
              <div v-if="ele.value == form.flight_ids[0]">
                <div>{{'日期:  '+ ele.date}}</div>
                <div>{{'航班号:  '+ ele.flight_no}}</div>
                <div>{{'起飞时间:  '+ ele.start_fly_time}}</div>
                <div>{{'降落时间:  '+ ele.end_fly_time}}</div>
                <div>{{'起飞机场:  '+ ele.start_airport}}</div>
                <div>{{'降落机场:  '+ ele.end_airport}}</div>
              </div>
            </template>
          </el-form-item>

          <el-form-item v-if="form.is_double" label="返程航班：" >
            <el-select  v-model="form.flight_ids[1]" placeholder="请选择">
              <el-option
                v-for="item in option1" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
            <template v-for="ele in  option1">
              <div v-if="ele.value == form.flight_ids[1]">
                <div>{{'日期:  '+ ele.date}}</div>
                <div>{{'航班号:  '+ ele.flight_no}}</div>
                <div>{{'起飞时间:  '+ ele.start_fly_time}}</div>
                <div>{{'降落时间:  '+ ele.end_fly_time}}</div>
                <div>{{'起飞机场:  '+ ele.start_airport}}</div>
                <div>{{'降落机场:  '+ ele.end_airport}}</div>
              </div>
            </template>
          </el-form-item>

          <el-form-item>
            <el-alert v-show="is_show_auto_match_flight" title="未自动匹配到返程航班，请创建！" type="error"></el-alert>
          </el-form-item>
        </div>

        <el-form-item label="备注信息：">
          <el-input :rows="3" :col="5" type="textarea" v-model="form.beizhu"></el-input>
        </el-form-item>
        <br/>
        <el-form-item  style="margin-left: 100px" >
          <el-button type="primary" @click="onSubmit('form')">立即创建</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>

    <el-dialog :title="'编辑'"  :visible.sync="editDialogFormVisible">
      <el-form :inline="true"  ref="form" :model="form" label-width="100px"  v-loading="formLoading" >
        <el-form-item label="记录编码：" >
          <el-input readonly v-model="form.code"  placeholder="如不输入，系统将默认生成"></el-input>
        </el-form-item>

        <el-form-item label="乘客姓名：" >
          <el-input v-model="form.name"></el-input>
        </el-form-item>
        <el-form-item label="乘客性别：" >
          <el-select v-model="form.passenger_sex" placeholder="请选择">
            <el-option key="1" label="男" value="M" ></el-option>
            <el-option key="2" label="女" value="F" ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="乘客生日：" >
          <el-date-picker
            value-format="yyyy-MM-dd"
            v-model="form.passenger_birthday"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="护照号码：" >
          <el-input v-model="form.passport"></el-input>
        </el-form-item>

        <div>
          <el-form-item label="日期：" >
            <el-date-picker @change="changeFlightDate0" v-model="form.flight_dates[0]" type="date" placeholder="选择日期" :picker-options="pickerOptions" value-format="yyyy-MM-dd">
            </el-date-picker>
          </el-form-item>

          <el-form-item v-if="form.is_double" label="返程日期：" >
            <el-date-picker @change="changeFlightDate1" v-model="form.flight_dates[1]" type="date" placeholder="选择日期" :picker-options="pickerOptions" value-format="yyyy-MM-dd">
            </el-date-picker>
          </el-form-item>
        </div>


        <div>
          <el-form-item label="航班：" >
            <el-select v-model="form.flight_ids[0]" placeholder="请选择">
              <el-option
                v-for="item in option0" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
            <template v-for="ele in  option0">
              <div v-if="ele.value == form.flight_ids[0]">
                <div>{{'日期:  '+ ele.date}}</div>
                <div>{{'航班号:  '+ ele.flight_no}}</div>
                <div>{{'起飞时间:  '+ ele.start_fly_time}}</div>
                <div>{{'降落时间:  '+ ele.end_fly_time}}</div>
                <div>{{'起飞机场:  '+ ele.start_airport}}</div>
                <div>{{'降落机场:  '+ ele.end_airport}}</div>
              </div>
            </template>
          </el-form-item>

          <el-form-item v-if="form.is_double" label="返程航班：" >
            <el-select  v-model="form.flight_ids[1]" placeholder="请选择">
              <el-option
                v-for="item in option1" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
            <template v-for="ele1 in  option1">
              <div v-if="ele1.value == form.flight_ids[1]">
                <div>{{'日期:  '+ ele1.date}}</div>
                <div>{{'航班号:  '+ ele1.flight_no}}</div>
                <div>{{'起飞时间:  '+ ele1.start_fly_time}}</div>
                <div>{{'降落时间:  '+ ele1.end_fly_time}}</div>
                <div>{{'起飞机场:  '+ ele1.start_airport}}</div>
                <div>{{'降落机场:  '+ ele1.end_airport}}</div>
              </div>
            </template>
          </el-form-item>
        </div>

        <el-form-item label="备注信息：">
          <el-input :rows="3" :col="8" type="textarea" v-model="form.beizhu"></el-input>
        </el-form-item>
        <br/>
        <el-form-item   style="margin-left: 100px">
          <el-button type="primary" @click="edit('form')">修改</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>

    <el-dialog :title="'修改备注'"  :visible.sync="editDialogBeizhuVisible">
      <el-form ref="form" :model="form" label-width="100px"   >
        <el-form-item label="乘客姓名：" >
          <el-input readonly v-model="form.name"></el-input>
        </el-form-item>
        <el-form-item label="备注信息：">
          <el-input :rows="3"  type="textarea" v-model="form.beizhu"></el-input>
        </el-form-item>

        <el-form-item >
          <el-button type="primary" @click="beizhu('form')">修改</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>

<!--pdf-->

  </div>
</template>

<script>

import { myGet,myPost,exportXls } from '@/utils/myUtils'
import {getToken} from "@/utils/auth";

const urlDefaultFlight = '/guard/flight/order/getDefaultFlight';
const urlFlightLst = '/guard/flight/lst';
const urlUserCode = '/guard/flight/order/getOrderCode';
const urlUserLst = '/guard/flight/order/lst';
const urlAddUser = '/guard/flight/order/add';
const urlEditUser = '/guard/flight/order/edit';
const urlEditBeizhu = '/guard/flight/order/beizhu';
const urlGetUser = '/guard/flight/order/detail';
const urlDeleteUser = '/guard/flight/order/del';
const urlDownloadUser = '/guard/download';

export default {

    data() {
        return {
          selectId:[],
          currentAuth:'',
          token:"",
          pdfdialogVisible:false,
					host:process.env.VUE_APP_HOST,
					query:{
            code:'',
            fullName:'',
            writerName:'',
            type:2,
            createdAt:[],
            startDate:''
					},
          form:{
            id:0,
            count:1,
            code:'',
            is_double:true,
            name:'',
            last_name:'',
            first_name:'',
            passenger_sex:'M',
            passenger_birthday:'',
            passport:'',
            flight_dates:['',''],
            flight_ids:['',''],
            beizhu:''
          },

          option0:[],
          option1:[],
					list: [],
          defaultFlight:'',
          pagination:{
            total:0,
            page:1,
            pageSize:20,
          },
					formLoading:false,
					listLoading: true,
          addDialogFormVisible:false,
          editDialogFormVisible:false,
          editDialogBeizhuVisible:false,
          pickerOptions: {
            shortcuts: [{
              text: '今天',
              onClick(picker) {
                picker.$emit('pick', new Date());
              }
            }, {
              text: '昨天',
              onClick(picker) {
                const date = new Date();
                date.setTime(date.getTime() - 3600 * 1000 * 24);
                picker.$emit('pick', date);
              }
            }, {
              text: '一周前',
              onClick(picker) {
                const date = new Date();
                date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
                picker.$emit('pick', date);
              }
            }]
          },
          is_show_auto_match_flight:false
        }
    },

    methods: {

      downloadPDF(index,row){

        const url = "http://api.fireflyzair.com/guard/download?downloadType=pdf&code="+row.code
        console.log(url)
        exportXls(url);
      },
      getDefaultFlight(){
        myGet(urlDefaultFlight,).then(res=>{
          if(res.status){
            this.defaultFlight = res.data.records.val
          }
        })
      },
      handleBeizhu(index, row){
        Object.assign(this.$data.form,this.$options.data().form)
        this.form.id = row.id
        this.form.beizhu = row.beizhu
        this.form.name = row.name
        this.editDialogBeizhuVisible = true

      },

      beizhu(formName){
        this.$refs[formName].validate((valid) => {
          if (valid) {
            myPost(urlEditBeizhu,this.form).then(res=>{
              this.editDialogBeizhuVisible = false;
              if(res.status){
                this.$message.success(res.msg);
                this.getRecords()
              }
            })
          } else {
            this.$message.error('验证失败！');
            return false;
          }
        });
      },

      handleEdit(index, row) {
        this.editDialogFormVisible = true
        this.form.id = row.id
        this.form.count = 1
        this.form.code = row.code
        this.form.name = row.name
        this.form.beizhu = row.beizhu
        this.form.is_double = row.is_double=='往返'?true:false
        this.form.passenger_sex = row.passenger_sex=='男'?'M':'F'
        this.form.passenger_birthday = row.passenger_birthday.replaceAll('/','-')
        this.form.passport = row.passport
        this.form.flight_ids[0] = row.flight_id
        this.form.flight_ids[1] = row.couple_flight_id
        this.form.flight_dates[0] = row.get_flight_info.date
        this.form.flight_dates[1] = row.get_couple_flight_info.date
        this.option0 = []
        this.option1 = []
        myGet(urlFlightLst,{able:1,date:row.get_flight_info.date}).then(res=>{
          let records = res.data.records;
          for (let i = 0; i < records.length; i++) {
            let dinfo = {
              'label':records[i].label,
              'value':records[i].value,
              'date':records[i].date,
              'flight_no':records[i].flight_no,
              'start_fly_time':records[i].start_fly_time,
              'end_fly_time':records[i].end_fly_time,
              'start_airport':records[i].start_airport,
              'end_airport':records[i].end_airport,
              'couple_flight_no':records[i].couple_flight_no,
            }
            this.option0.push(dinfo)
          }
        })

        myGet(urlFlightLst,{able:1,date:row.get_couple_flight_info.date}).then(res=>{
          let records = res.data.records;
          for (let i = 0; i < records.length; i++) {
            let dinfo = {
              'label':records[i].label,
              'value':records[i].value,
              'date':records[i].date,
              'flight_no':records[i].flight_no,
              'start_fly_time':records[i].start_fly_time,
              'end_fly_time':records[i].end_fly_time,
              'start_airport':records[i].start_airport,
              'end_airport':records[i].end_airport,
              'couple_flight_no':records[i].couple_flight_no,
            }
            this.option1.push(dinfo)
          }
        })
      },
      changeFlightDate0(date){
        this.option0 = []
        this.form.flight_ids[0] = ''
        myGet(urlFlightLst,{able:1,date:date}).then(res=>{
          let records = res.data.records;
          for (let i = 0; i < records.length; i++) {
            this.option0.push({
              'label':records[i].label,
              'value':records[i].value,
              'date':records[i].date,
              'flight_no':records[i].flight_no,
              'start_fly_time':records[i].start_fly_time,
              'end_fly_time':records[i].end_fly_time,
              'start_airport':records[i].start_airport,
              'end_airport':records[i].end_airport,
              'couple_flight_no':records[i].couple_flight_no,
            })
            if(records[i].flight_no==this.defaultFlight){
              this.form.flight_ids[0] = records[i].value
            }
          }
        })
      },
      changeFlightDate1(date){
        this.option1 = []
        this.form.flight_ids[1] = ''
        let id = this.form.flight_ids[0]
        //获取选择的第一个航班号
        let couple_flight_no = ''
        for (let i = 0; i < this.option0.length; i++) {
          if(id == this.option0[i].value){
            couple_flight_no = this.option0[i].couple_flight_no
            break
          }
        }
        myGet(urlFlightLst,{able:1,date}).then(res=>{
          let records = res.data.records;
          for (let i = 0; i < records.length; i++) {
            this.option1.push({
              'label':records[i].label,
              'value':records[i].value,
              'date':records[i].date,
              'flight_no':records[i].flight_no,
              'start_fly_time':records[i].start_fly_time,
              'end_fly_time':records[i].end_fly_time,
              'start_airport':records[i].start_airport,
              'end_airport':records[i].end_airport,
              'couple_flight_no':records[i].couple_flight_no,
            })
            if(couple_flight_no==records[i].flight_no){
              this.form.flight_ids[1] = records[i].value
              this.is_show_auto_match_flight = false
            }
          }

          //如果没有匹配到返程的航班行
          if(this.form.flight_ids[1]==''){
            this.is_show_auto_match_flight = true
          }

        })
      },

      edit(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            //this.formLoading = true;
            myPost(urlEditUser,this.form).then(res=>{
              this.formLoading = false;
              this.editDialogFormVisible = false;
              if(res.status){
                this.$message.success(res.msg);
                this.getRecords()
              }
            })
          } else {
            this.$message.error('验证失败！');
            return false;
          }
        });
      },
      onSubmit(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            myPost(urlAddUser,this.form).then(res=>{
              this.formLoading = false;

              if(res.status){
                this.addDialogFormVisible = false;
                this.$message.success(res.msg);
                this.getRecords()
              }
            })
          } else {
            this.$message.error('验证失败！');
            return false;
          }
        });
      },
      openAddDialog(){
        Object.assign(this.$data.form,this.$options.data().form)
        this.addDialogFormVisible = true
        this.getOrderCode()
      },

      getOrderCode(){
        myGet(urlUserCode).then(res=>{
          this.form.code = res.data.records.code;
        })
      },


      uploadSuccess(res, file, fileList){
        if(res.status){
           this.$message.success(res.msg)
           this.getRecords();
        }else{
          this.$message.error(res.msg)
        }
      },
      uploadError(err, file, fileList){
        //console.log(err)
      },
      uploadProcess(event, file, fileList){
        //console.log(event)
      },

      download(){
        const url = this.host+urlDownloadUser+"?downloadType=flight&fullName="+this.query.fullName+"&code="+this.query.code
        exportXls(url);
      },

      downloadCsv(){
        const url = this.host+urlDownloadUser+"?downloadType=muban&fullName="+this.query.fullName+"&code="+this.query.code
        exportXls(url);
      },

      reload(){
        Object.assign(this.$data.query,this.$options.data().query)
        Object.assign(this.$data.pagination,this.$options.data().pagination)
        this.getRecords()
      },
			getRecords(){
        this.listLoading = true;
        let params = Object.assign(this.query,this.pagination)
        myGet(urlUserLst,params).then((res) =>{
          this.listLoading = false;
          if(res.status){
            this.list = res.data.records
            this.currentAuth = res.data.currentAuth
            //console.log(this.currentAuth)
            this.pagination.total = res.data.total
          }
        })
      },

			changeStatus(row){
        myPost(urlAddUser,{id:row.id, status:row.status}).then(res => {
          if(res.status){
            this.$message.success(res.msg)
          }
        })
			},

			handleDelete(index, row) {
					this.$confirm('确定删除吗？', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
					}).then(() => {
            let code = row.code
            myGet(urlDeleteUser, { code }).then(res => {
              if (res.status) {
                this.$message.success(res.msg);
                this.reload();
              }
            })
          })
			},

      handleMultDel(){
        this.$confirm('确定要删除吗？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          let ids = this.selectId
          myGet(urlDeleteUser,{ids}).then(res=>{
            if(res.status){
              this.$message.success(res.msg)
              this.getRecords()
            }
          })
        });
      },

      handleDownload(index, row){
        let id = row.id
        const url = this.host+urlDownloadUser+"?downloadType=flightDownload&id="+id
        exportXls(url)
      },

			handleSizeChange(val) {
					this.pagination.pageSize = val
					this.pagination.page = 1
					this.getRecords()
			},
			handleCurrentChange(val) {
					this.pagination.page = val
					this.getRecords();
			},

      handleSelectionChange(val) {
        this.selectId = [];
        val.forEach(item=>{
          this.selectId.push(item.id)
        })
      },

			//多选
			toggleSelection(rows) {
					if (rows) {
            rows.forEach(row => {
                this.$refs.multipleTable.toggleRowSelection(row);
            });
					} else {
							this.$refs.multipleTable.clearSelection();
					}
			}
    },
    mounted() {
      this.getRecords()
      this.getDefaultFlight()
      this.token = getToken()
    }
}
</script>

<style>

.table-img{
    width: 50px;
    height: 50px;
}

.avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.avatar-uploader .el-upload:hover {
    border-color: #409EFF;
}
.avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 100px;
    height: 100px;
    line-height: 100px;
    text-align: center;
}
.avatar {
    width: 100px;
    height: 100px;
    display: block;
}
</style>


